﻿@inherits BaseComponent

<div class="ant-input-affix-wrapper">
    @if (!string.IsNullOrWhiteSpace(Icon))
    {
        <i class="@Icon" />
    }
    <input type="password" id="@Id" name="@Id" class="ant-input" @attributes="InputAttributes" />
</div>

@code {
    [Parameter] public bool Required { get; set; }
    [Parameter] public string Icon { get; set; }
    [Parameter] public string Placeholder { get; set; }

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();
        InputAttributes.Clear();
        InputAttributes.AddItem("aria-required", Required);
        InputAttributes.AddItem("placeholder", Placeholder);
    }
}